#include<iostream>
#include<map>
#include<bitset>
using namespace std;
typedef long long LL;
const int N = 2e6 + 10;
int n;
bitset<N>f;
int main()
{
	cin >> n;
	f[0] = 1;
	for (int i = 0; i < n; i++) {
		int x;
		cin >> x;
		f = f ^ (f << x);
	}
	int ans = 0;
	for (int i = 0; i <= N - 10; i++) {
		if (f[i])ans ^= i;
	}
	cout << ans << endl;
	return 0;
}